//////////////////////////////////////////////////////////////////////////
// FileName:
// CreateBy:
// CreateDate:2010/5/25
// Description:
//		BusOilManage class
//
// Modify Log:
//
// Copyright:
/////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Auto.Components;

namespace Auto.Data.BusMan.Model
{
    [Serializable]
    public class BusOilManage
    {
        #region --Field--
        ///<summary>
        ///Data Table Bus_BusOilManage
        ///</summary>
        public const string TABLENAME_Bus_BusOilManage = "Bus_BusOilManage";
        /// <sumary> 
        /// (RecID Type:Int Len:0) 
        /// </sumary> 
        public const string FIELD_RecID = "RecID";
        /// <sumary> 
        /// (DocID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_DocID = "DocID";
        /// <sumary> 
        /// (BusID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_BusID = "BusID";
        /// <sumary> 
        /// (CompanyID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_CompanyID = "CompanyID";
        /// <sumary> 
        /// (CompanyName Type:NVarChar Len:50) 
        /// </sumary> 
        public const string FIELD_CompanyName = "CompanyName";
        /// <sumary> 
        /// (DriverID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_DriverID = "DriverID";
        /// <sumary> 
        /// (OilCardNO Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_OilCardNO = "OilCardNO";
        /// <sumary> 
        /// (OilDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_OilDate = "OilDate";
        /// <sumary> 
        /// (OilStartDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_OilStartDate = "OilStartDate";
        /// <sumary> 
        /// (OilEndDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_OilEndDate = "OilEndDate";
        /// <sumary> 
        /// (OilCardRecharge Type:Decimal Len:0) 
        /// </sumary> 
        public const string FIELD_OilCardRecharge = "OilCardRecharge";
        /// <sumary> 
        /// (OilCostByCard Type:Decimal Len:0) 
        /// </sumary> 
        public const string FIELD_OilCostByCard = "OilCostByCard";
        /// <sumary> 
        /// (OilVolumeByCard Type:Decimal Len:0) 
        /// </sumary> 
        public const string FIELD_OilVolumeByCard = "OilVolumeByCard";
        /// <sumary> 
        /// (OilCostByCash Type:Decimal Len:0) 
        /// </sumary> 
        public const string FIELD_OilCostByCash = "OilCostByCash";
        /// <sumary> 
        /// (OilVolumeByCash Type:Decimal Len:0) 
        /// </sumary> 
        public const string FIELD_OilVolumeByCash = "OilVolumeByCash";
        /// <sumary> 
        /// (OdometerBus Type:Decimal Len:0) 
        /// </sumary> 
        public const string FIELD_OdometerBus = "OdometerBus";
        /// <sumary> 
        /// (OdometerBusStart Type:Decimal Len:0) 
        /// </sumary> 
        public const string FIELD_OdometerBusStart = "OdometerBusStart";
        /// <sumary> 
        /// (OdometerBusEnd Type:Decimal Len:0) 
        /// </sumary> 
        public const string FIELD_OdometerBusEnd = "OdometerBusEnd";
        /// <sumary> 
        /// (OdometerGPS Type:Decimal Len:0) 
        /// </sumary> 
        public const string FIELD_OdometerGPS = "OdometerGPS";
        /// <sumary> 
        /// (RecAcct Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_RecAcct = "RecAcct";
        /// <sumary> 
        /// (RecDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_RecDate = "RecDate";
        /// <sumary> 
        /// (RecDivID Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_RecDivID = "RecDivID";
        /// <sumary> 
        /// (Note Type:NVarChar Len:50) 
        /// </sumary> 
        public const string FIELD_Note = "Note";
        /// <sumary> 
        /// (UserAcct Type:VarChar Len:20) 
        /// </sumary> 
        public const string FIELD_UserAcct = "UserAcct";
        /// <sumary> 
        /// (LastUpdateDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public const string FIELD_LastUpdateDate = "LastUpdateDate";
        #endregion --Field--

        #region --Property--
        private int _recid;
        private string _docid;
        private string _busid;
        private string _companyid;
        private string _companyname;
        private string _driverid;
        private string _oilcardno;
        private DateTime _oildate;
        private DateTime _oilstartdate;
        private DateTime _oilenddate;
        private decimal _oilcardrecharge;
        private decimal _oilcostbycard;
        private decimal _oilvolumebycard;
        private decimal _oilcostbycash;
        private decimal _oilvolumebycash;
        private decimal _odometerbus;
        private decimal _odometerbusstart;
        private decimal _odometerbusend;
        private decimal _odometergps;
        private string _recacct;
        private DateTime _recdate;
        private string _recdivid;
        private string _note;
        private string _useracct;
        private DateTime _lastupdatedate;

        /// <sumary> 
        /// (RecID Type:Int Len:0) 
        /// </sumary> 
        public int RecID
        {
            set { _recid = value; }
            get { return _recid; }
        }

        /// <sumary> 
        /// (DocID Type:VarChar Len:20) 
        /// </sumary> 
        public string DocID
        {
            set { _docid = value; }
            get { return _docid; }
        }

        /// <sumary> 
        /// (BusID Type:VarChar Len:20) 
        /// </sumary> 
        public string BusID
        {
            set { _busid = value; }
            get { return _busid; }
        }

        /// <sumary> 
        /// (CompanyID Type:VarChar Len:20) 
        /// </sumary> 
        public string CompanyID
        {
            set { _companyid = value; }
            get { return _companyid; }
        }

        /// <sumary> 
        /// (CompanyName Type:NVarChar Len:50) 
        /// </sumary> 
        public string CompanyName
        {
            set { _companyname = value; }
            get { return _companyname; }
        }

        /// <sumary> 
        /// (DriverID Type:VarChar Len:20) 
        /// </sumary> 
        public string DriverID
        {
            set { _driverid = value; }
            get { return _driverid; }
        }

        /// <sumary> 
        /// (OilCardNO Type:VarChar Len:20) 
        /// </sumary> 
        public string OilCardNO
        {
            set { _oilcardno = value; }
            get { return _oilcardno; }
        }

        /// <sumary> 
        /// (OilDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime OilDate
        {
            set { _oildate = value; }
            get { return _oildate; }
        }

        /// <sumary> 
        /// (OilStartDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime OilStartDate
        {
            set { _oilstartdate = value; }
            get { return _oilstartdate; }
        }

        /// <sumary> 
        /// (OilEndDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime OilEndDate
        {
            set { _oilenddate = value; }
            get { return _oilenddate; }
        }
        /// <sumary> 
        /// (OilCardRecharge Type:Decimal Len:0) 
        /// </sumary> 
        public decimal OilCardRecharge
        {
            set { _oilcardrecharge = value; }
            get { return _oilcardrecharge; }
        }

        /// <sumary> 
        /// (OilCostByCard Type:Decimal Len:0) 
        /// </sumary> 
        public decimal OilCostByCard
        {
            set { _oilcostbycard = value; }
            get { return _oilcostbycard; }
        }

        /// <sumary> 
        /// (OilVolumeByCard Type:Decimal Len:0) 
        /// </sumary> 
        public decimal OilVolumeByCard
        {
            set { _oilvolumebycard = value; }
            get { return _oilvolumebycard; }
        }

        /// <sumary> 
        /// (OilCostByCash Type:Decimal Len:0) 
        /// </sumary> 
        public decimal OilCostByCash
        {
            set { _oilcostbycash = value; }
            get { return _oilcostbycash; }
        }

        /// <sumary> 
        /// (OilVolumeByCash Type:Decimal Len:0) 
        /// </sumary> 
        public decimal OilVolumeByCash
        {
            set { _oilvolumebycash = value; }
            get { return _oilvolumebycash; }
        }

        /// <sumary> 
        /// (OdometerBus Type:Decimal Len:0) 
        /// </sumary> 
        public decimal OdometerBus
        {
            set { _odometerbus = value; }
            get { return _odometerbus; }
        }

        /// <sumary> 
        /// (OdometerBusStart Type:Decimal Len:0) 
        /// </sumary> 
        public decimal OdometerBusStart
        {
            set { _odometerbusstart = value; }
            get { return _odometerbusstart; }
        }


        /// <sumary> 
        /// (OdometerBusEnd Type:Decimal Len:0) 
        /// </sumary> 
        public decimal OdometerBusEnd
        {
            set { _odometerbusend = value; }
            get { return _odometerbusend; }
        }

        /// <sumary> 
        /// (OdometerGPS Type:Decimal Len:0) 
        /// </sumary> 
        public decimal OdometerGPS
        {
            set { _odometergps = value; }
            get { return _odometergps; }
        }

        /// <sumary> 
        /// (RecAcct Type:VarChar Len:20) 
        /// </sumary> 
        public string RecAcct
        {
            set { _recacct = value; }
            get { return _recacct; }
        }

        /// <sumary> 
        /// (RecDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime RecDate
        {
            set { _recdate = value; }
            get { return _recdate; }
        }

        /// <sumary> 
        /// (RecDivID Type:VarChar Len:20) 
        /// </sumary> 
        public string RecDivID
        {
            set { _recdivid = value; }
            get { return _recdivid; }
        }

        /// <sumary> 
        /// (Note Type:NVarChar Len:50) 
        /// </sumary> 
        public string Note
        {
            set { _note = value; }
            get { return _note; }
        }

        /// <sumary> 
        /// (UserAcct Type:VarChar Len:20) 
        /// </sumary> 
        public string UserAcct
        {
            set { _useracct = value; }
            get { return _useracct; }
        }

        /// <sumary> 
        /// (LastUpdateDate Type:SmallDateTime Len:0) 
        /// </sumary> 
        public DateTime LastUpdateDate
        {
            set { _lastupdatedate = value; }
            get { return _lastupdatedate; }
        }

        #endregion --Property--

        #region --New--
        /// <summary>
        /// Constructed Function
        /// </summary>
        public BusOilManage()
        {
            Init();
        }
        /// <summary>
        /// Constructed Function
        /// </summary>
        /// <param name="dr">DataRow</param>
        public BusOilManage(DataRow dr)
        {
            Init();
            SetModel(dr);
        }
        /// <summary>
        /// Constructed Function
        /// </summary>
        /// <param name="dt">DataTable</param>
        public BusOilManage(DataTable dt)
        {
            Init();
            SetModel(dt);
        }
        #endregion --New--

        #region --Private--
        /// <summary>
        /// Init The Private variable
        /// </summary>
        private void Init()
        {
            _recid = 0;
            _docid = string.Empty;
            _busid = string.Empty;
            _companyid = string.Empty;
            _companyname = string.Empty;
            _driverid = string.Empty;
            _oilcardno = string.Empty;
            _oildate = DateTime.MinValue;
            _oilstartdate = DateTime.MinValue;
            _oilenddate = DateTime.MinValue;
            _oilcardrecharge = 0;
            _oilcostbycard = 0;
            _oilvolumebycard = 0;
            _oilcostbycash = 0;
            _oilvolumebycash = 0;
            _odometerbus = 0;
            _odometerbusstart = 0;
            _odometerbusend = 0;
            _odometergps = 0;
            _recacct = string.Empty;
            _recdate = DateTime.MinValue;
            _recdivid = string.Empty;
            _note = string.Empty;
            _useracct = string.Empty;
            _lastupdatedate = DateTime.MinValue;
        }
        /// <summary>
        /// SetModel By DataRow
        /// </summary>
        /// <param name="dr">DataRow</param>
        /// <returns>BusOilManage</returns>
        private BusOilManage SetModel(DataRow dr)
        {
            _recid = StrHelper.GetIntValue(dr[FIELD_RecID]);
            _docid = StrHelper.GetStringValue(dr[FIELD_DocID]);
            _busid = StrHelper.GetStringValue(dr[FIELD_BusID]);
            _companyid = StrHelper.GetStringValue(dr[FIELD_CompanyID]);
            _companyname = StrHelper.GetStringValue(dr[FIELD_CompanyName]);
            _driverid = StrHelper.GetStringValue(dr[FIELD_DriverID]);
            _oilcardno = StrHelper.GetStringValue(dr[FIELD_OilCardNO]);
            _oildate = StrHelper.GetDateTimeValue(dr[FIELD_OilDate]);
            _oilstartdate = StrHelper.GetDateTimeValue(dr[FIELD_OilStartDate]);
            _oilenddate = StrHelper.GetDateTimeValue(dr[FIELD_OilEndDate]);
            _oilcardrecharge = StrHelper.GetDecimalValue(dr[FIELD_OilCardRecharge]);
            _oilcostbycard = StrHelper.GetDecimalValue(dr[FIELD_OilCostByCard]);
            _oilvolumebycard = StrHelper.GetDecimalValue(dr[FIELD_OilVolumeByCard]);
            _oilcostbycash = StrHelper.GetDecimalValue(dr[FIELD_OilCostByCash]);
            _oilvolumebycash = StrHelper.GetDecimalValue(dr[FIELD_OilVolumeByCash]);
            _odometerbus = StrHelper.GetDecimalValue(dr[FIELD_OdometerBus]);
            _odometerbusstart = StrHelper.GetDecimalValue(dr[FIELD_OdometerBusStart]);
            _odometerbusend = StrHelper.GetDecimalValue(dr[FIELD_OdometerBusEnd]);
            _odometergps = StrHelper.GetDecimalValue(dr[FIELD_OdometerGPS]);
            _recacct = StrHelper.GetStringValue(dr[FIELD_RecAcct]);
            _recdate = StrHelper.GetDateTimeValue(dr[FIELD_RecDate]);
            _recdivid = StrHelper.GetStringValue(dr[FIELD_RecDivID]);
            _note = StrHelper.GetStringValue(dr[FIELD_Note]);
            _useracct = StrHelper.GetStringValue(dr[FIELD_UserAcct]);
            _lastupdatedate = StrHelper.GetDateTimeValue(dr[FIELD_LastUpdateDate]);
            return this;
        }
        /// <summary>
        /// SetModel By DataTable
        /// </summary>
        /// <param name="dt">DataTable</param>
        /// <returns>BusOilManage</returns>
        private BusOilManage SetModel(DataTable dt)
        {
            foreach (DataRow dr in dt.Rows)
            {
                SetModel(dr);
                break;
            }
            return this;
        }
        #endregion --Private--

    }
}

